ns16550: Implement suspend handler.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 8 Jul 2011 07:42:30 +0000 (08:42 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 8 Jul 2011 07:42:30 +0000 (08:42 +0100)
For PCI type cards, you need to disable the timer code during
suspend. Otherwise during resume, the timer can be put on the
heap as its being resumed and corrupt it resulting in a crash.

Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/drivers/char/ns16550.c

index 8d376b8fec3ab99db118bcfcb6418c1f854f4eb9..c360ee70f553b52a95a3defcd999e55baf788668 100644 (file)
@@ -328,6 +328,12 @@ static void __init ns16550_init_postirq(struct serial_port *port)
     ns16550_setup_postirq(uart);
 }
 
+static void ns16550_suspend(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+    stop_timer(&uart->timer);
+}
+
 static void ns16550_resume(struct serial_port *port)
 {
     ns16550_setup_preirq(port->uart);
@@ -355,6 +361,7 @@ static struct uart_driver __read_mostly ns16550_driver = {
     .init_preirq  = ns16550_init_preirq,
     .init_postirq = ns16550_init_postirq,
     .endboot      = ns16550_endboot,
+    .suspend      = ns16550_suspend,
     .resume       = ns16550_resume,
     .tx_empty     = ns16550_tx_empty,
     .putc         = ns16550_putc,